package com.novel.utils;

import weibo4j.Account;
import weibo4j.Friendships;

public final class IsFriends {
	
	public static boolean isFriends(String token){
		Account am = new Account();
		Friendships friend = new Friendships();
		String uid = "1921659541";
		String uid2 = "2204381500";
		am.client.setToken(token);
		friend.setToken(token);
		try {
			String own = am.getUid().getString("uid");
			String[] users = friend.getFriendsIdsByUid(own);
			boolean mid = false;
			if(own.equals(uid)||own.equals(uid2)){
				return true;
			}
			for(String temp : users){
				if(mid==false&&(temp.equals(uid)||temp.equals(uid2))){
					mid = true;
					continue;
				}
				
				if(mid==true&&(temp.equals(uid)||temp.equals(uid2))){
					return true;
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}
}
